home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GETS(3) MINTLIB LIBRARY FUNCTIONS GETS(3)
-
-
- N✓NA✓AM✓ME✓E
- gets, fgets - get a string from a stream
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <stdio.h>
-
- char *gets(char *s);
-
- char *fgets(char *s, int n, FILE *stream);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- gets reads characters from the standard input stream,
- stdin, into the array pointed to by s, until a new-line
- character is read or an end-of-file condition is encoun-
- tered. The new-line character is discarded and the string
- is terminated with a null character.
-
- fgets reads character from the file stream into the array
- pointed to by s, until n-1 characters are read, or a new-
- line character is read and transferred to s, or an end-of-
- file condition is encountered. The string is then termi-
- nated with a null character.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- f✓fe✓er✓rr✓ro✓or✓r(✓(3✓3)✓),✓, f✓fo✓op✓pe✓en✓n(✓(3✓3)✓),✓, f✓fr✓re✓ea✓ad✓d(✓(3✓3)✓),✓, g✓ge✓et✓tc✓c(✓(3✓3)✓),✓, s✓sc✓ca✓an✓nf✓f(✓(3✓3)✓)
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- If end-of-file is encountered and no characters have been
- read, no characters are transferred to s and a NULL
- pointer is returned. If a read error occurs, such as try-
- ing to use these functions on a file that has not been
- opened for reading, a NULL pointer is returned. Otherwise
- s is returned.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-